package com.jemmyee.task.web.controller.admin;

import javax.servlet.http.HttpServletRequest;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import com.jemmyee.core.utils.ConfigXmlUtils;
import com.jemmyee.core.web.Constants;
import com.jemmyee.core.web.controller.kernel.BaseCoreController;
import com.jemmyee.task.web.TaskConstants;

/**
 * @Description:系统设置等
 * @author:jemmyee@gmail.com
 * @date:2011-9-8
 * @version:v1.0
 */
@Controller("taskMainController")
@RequestMapping(Constants.MV_URI_APP_TASK+Constants.MV_URI_MAIN_ADMIN+Constants.SYM_PATH_SEPARATOR+"main")
public class MainController extends BaseCoreController{
	
	private static Log log= LogFactory.getLog(MainController.class);

	private static final String ROOT_VIEW =Constants.MV_URI_MAIN_ADMIN+Constants.MV_URI_APP_TASK+Constants.SYM_PATH_SEPARATOR+"main";
	private static final String ROOT_URI=Constants.MV_URI_APP_TASK+Constants.MV_URI_MAIN_ADMIN+Constants.SYM_PATH_SEPARATOR+"main";
	/**
	* @Description:主框架
	* @author:jemmyee@gmail.com
	* @date:2010-10-20
	*/
	@RequestMapping("/toSet/{tabID}")
	public ModelAndView toSet(@PathVariable Integer tabID,HttpServletRequest request){
		ModelAndView mv=new ModelAndView();
		mv.addObject(Constants.MV_OBJECT_ROOT_URI,ROOT_URI);
		mv.addObject("tabID",tabID);
		mv.setViewName(ROOT_VIEW+"/set");
		if(tabID.intValue()==3)
		{
			mv.addObject("regPoints",ConfigXmlUtils.getConfig(getAppRoot(request)+TaskConstants.CONFIG_XML_FILE,"user","regPoints"));
			mv.addObject("regMsg",ConfigXmlUtils.getConfig(getAppRoot(request)+TaskConstants.CONFIG_XML_FILE,"user","regMsg")); 
		}
		return mv;
	}
}
